package com.study.hot.jetpack.hilt.module

import android.app.Application
import com.study.hot.di.dagger.DaggerApp
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent

/**
 * <pre>
 *     author : slx
 *     time   : 2020/11/24
 *     desc   : 提供自定义Application
 * </pre>
 */
@Module
@InstallIn(SingletonComponent::class)
class ApplicationModule {

    @Provides
    fun provideApplication(application: Application): DaggerApp {
        // 全局Application就是自定义的MyApp，强转一定成功
        return application as DaggerApp
    }
}